package com.dgd.test.demo.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;


@Aspect
@Component
public class LogAspect {


    @Before("execution(* com.dgd.test.demo.controller.*.*(..))")
    public void doBefore(JoinPoint joinPoint){
        System.out.println("doBefore"+joinPoint.getSignature().getName());
    }

    @After("execution(* com.dgd.test.demo.controller.TeacherController.*(..))")
    public void doAfter(JoinPoint joinPoint){
        System.out.println("doAfter"+joinPoint.getSignature().getName());
    }


    @Around("execution(* com.dgd.test.demo.controller.TeacherController.*(..))")
    public Object deAround(ProceedingJoinPoint joinPoint) throws Throwable{
        System.out.println("deAround"+joinPoint.getSignature().getName());
        return joinPoint.proceed();
    }
}
